package com.zhang.zhangapp.view.shop;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;

import com.zhang.zhangapp.R;
import com.zhang.zhangapp.view.BaseFragment;
import com.zhang.zhangapp.view.adapter.FilterAdapter;

import org.xutils.view.annotation.ContentView;
import org.xutils.x;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/4/26.
 */

@ContentView(R.layout.fragment_filter)
public class FilterFragment extends BaseFragment {
    ListView listView;
    FilterAdapter adapter;
    List<Map<String, String>> filters;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        filters = (List<Map<String, String>>) this.getArguments().getSerializable("filters");
        View view = x.view().inject(this, inflater, container);
        adapter = new FilterAdapter(filters, getActivity());
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            }
        });
        return x.view().inject(this, inflater, container);
    }
}
